<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="show"></div>

    <input type="text" id="text" />
    <button id="s">sub</button>


    <script>
        document.querySelector('#s').onclick = function(){
            document.querySelector('#show').innerHTML = `
                <a href="${document.querySelector('#text').value}">link</a>
            `
        }
    </script>
</body>
</html>